﻿/*
 * RegExpress
 * 
 * Copyright (c) 2010, Daniel McGaughran
 * 
 * Licensed under the Apache Licence, Version 2.0 (the "Licence");
 * you may not use this file except in compliance with the Licence.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the Licence is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and
 * limitations under the Licence.
 * 
 */

using System;
using System.Xml;


namespace RegExpressModel
{
	interface ISettingsSerialiser
	{

		/// <summary>
		/// Saves the settings to XML.
		/// </summary>
		/// <param name="targetDocument">The target XML document.</param>
		/// <param name="targetElement">The target element where the settings are to be saved.</param>
		void SaveToXml(XmlDocument targetDocument, XmlElement targetElement);

		/// <summary>
		/// Extracts the settings from XML.
		/// </summary>
		/// <param name="parentElement">The parent element where settings reside.</param>
		/// <returns>True if all critical values were able to be extracted. If this is false,
		/// the caller may opt to employ an alternative method to set specific values that may be
		/// different to the default.</returns>
		bool ExtractFromXml(XmlElement parentElement);

	}
}
